@extends('user.public')

@section('content')
    <div class="col-sm-4">
        <section class="panel panel-default">
            <header class="panel-heading bg-light no-border">
                <div class="clearfix">
                    <a href="#" class="pull-left thumb-md avatar b-3x m-r">
                        <img src="{{ $logo or '/miya.png' }}" alt="{{ \Auth::user()->name }}">
                    </a>
                    <div class="clear">
                        <div class="h3 m-t-xs m-b-xs">
                            {{ \Auth::user()->name }}
                            <i class="fa fa-circle text-success pull-right text-xs m-t-sm"></i>
                        </div>
                        <small class="text-muted">{{ \Auth::user()->email }}</small>
                    </div>
                </div>
            </header>
            <div class="list-group no-radius alt">
                @if(!empty($infos))
                    @foreach($infos as $chunk => $num)
                        <a class="list-group-item" href="{{ route('user.chunk.info',$chunk) }}">
                            <span class="badge bg-success">{{ $num }}</span>
                            <i class="icon-drawer icon text-primary-lter"></i>&nbsp;&nbsp;{{ $chunklist[$chunk] }}
                        </a>
                    @endforeach
                @endif
            </div>
        </section>
        <section class="panel panel-info">
            <div class="panel-body">
                <div class="clear">
                    <small class="block text-muted">注册时间:{{ \Auth::user()->created_at }}</small>
                </div>
            </div>
        </section>
    </div>
    <div class="col-sm-8">
        <form data-validate="parsley" method="post" enctype="multipart/form-data">
            {!! csrf_field() !!}
            <section class="panel panel-default">
                <header class="panel-heading">
                    <span class="h4">资料编辑</span>
                </header>
                <div class="panel-body">
                    <p class="text-muted">请填写用户的详细信息</p>
                    <div class="form-group">
                        <label>账号</label>
                        <input type="text" class="form-control" value="{{ \Auth::user()->name }}"
                               disabled>
                    </div>
                    <div class="form-group">
                        <label>邮箱地址</label>
                        <input type="text" class="form-control" value="{{ \Auth::user()->email }}" disabled>
                    </div>
                    <div class="form-group">
                        <label>头像</label>
                        <div class="clearfix"></div>
                        <input type="file" name="image" class="filestyle" data-icon="false"
                               data-classButton="btn btn-default"
                               data-classInput="form-control inline v-middle input-s">
                    </div>
                    <div class="form-group">
                        <label>联系电话</label>
                        <input type="text" class="form-control parsley-validated"
                               placeholder="请填写联系方式" name="phone" value="{{ \Auth::user()->phone }}">
                    </div>
                    <div class="form-group">
                        <label>简介</label>
                        <textarea class="form-control parsley-validated" rows="6"
                                  placeholder="请填写简介" name="describe">{{ \Auth::user()->describe }}</textarea>
                    </div>
                </div>
                <footer class="panel-footer text-right bg-light lter">
                    <button type="submit" class="btn btn-success btn-s-xs">保存</button>
                </footer>
            </section>
        </form>
    </div>
@endsection

@section('css')
@endsection

@section('js')
    <!-- file input -->
    <script src="/public/theme/js/file-input/bootstrap-filestyle.min.js"></script>
    <!-- parsley -->
    <script src="/public/theme/js/parsley/parsley.min.js"></script>
    <script src="/public/theme/js/parsley/parsley.extend.js"></script>
@endsection